﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataFrameworkAccess.Entity;
using System.Data;
using Xinkui.Common.FileAction;
using Xinkui.Common.Enum;

namespace Back.Xinkui.Entity.Advert
{
    public class AdvertEntity
    {
        [DataMapping("RID", DbType.Int32)]
        public int RID { get; set; }

        /// <summary>
        /// 唯一标识
        /// </summary>
        [DataMapping("ID", DbType.Int32)]
        public int ID { get; set; }

        /// <summary>
        /// 所属广告版块ID
        /// </summary>
        [DataMapping("BoardID", DbType.Int32)]
        public int BoardID { get; set; }

        /// <summary>
        /// 所属广告位ID
        /// </summary>
        [DataMapping("SpaceID", DbType.Int32)]
        public int SpaceID { get; set; }

        /// <summary>
        /// 广告名称
        /// </summary>
        [DataMapping("AdvertName", DbType.String)]
        public string AdvertName { get; set; }

        /// <summary>
        /// 广告编号
        /// </summary>
        [DataMapping("AdvertNo", DbType.String)]
        public string AdvertNo { get; set; }

        /// <summary>
        /// 广告类型
        /// </summary>
        [DataMapping("AdvertType", DbType.Int32)]
        public int AdvertType { get; set; }

        /// <summary>
        /// 提示信息
        /// </summary>
        [DataMapping("Alt", DbType.String)]
        public string Alt { get; set; }

        /// <summary>
        /// 广告文件地址
        /// </summary>
        [DataMapping("AdvertPath", DbType.String)]
        public string AdvertPath { get; set; }

        public string viewAdvertPath
        {
            get
            {
                string Img = FileFactory.BrowerFile(AdvertPath, ESourceType.AD, 0, 0);
                return string.IsNullOrEmpty(Img) ? "/Themes/default/images/Img/noimage.jpg" : Img;
            }
        }

        /// <summary>
        /// 宽屏广告文件地址
        /// </summary>
        [DataMapping("BAdvertPath", DbType.String)]
        public string BAdvertPath { get; set; }

        public string viewBAdvertPath
        {
            get
            {
                string Img = FileFactory.BrowerFile(BAdvertPath, ESourceType.AD, 0, 0);
                return string.IsNullOrEmpty(Img) ? "/Themes/default/images/Img/noimage.jpg" : Img;
            }
        }

        /// <summary>
        /// 广告结束时间
        /// </summary>
        [DataMapping("EndTime", DbType.DateTime)]
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 广告开始时间
        /// </summary>
        [DataMapping("BeginTime", DbType.DateTime)]
        public DateTime BeginTime { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [DataMapping("Status", DbType.Int32)]
        public int Status { get; set; }

        /// <summary>
        /// 关键字
        /// </summary>
        [DataMapping("KeyWords", DbType.String)]
        public string KeyWords { get; set; }

        /// <summary>
        /// 链接
        /// </summary>
        [DataMapping("Url", DbType.String)]
        public string Url { get; set; }

        /// <summary>
        /// 广告文字
        /// </summary>
        [DataMapping("Text", DbType.String)]
        public string Text { get; set; }

        /// <summary>
        /// Crm公司的ID
        /// </summary>
        [DataMapping("CompanyCrmID", DbType.Int32)]
        public int CompanyCrmID { get; set; }

        /// <summary>
        /// 公司名称
        /// </summary>
        [DataMapping("CompanyName", DbType.String)]
        public string CompanyName { get; set; }

        /// <summary>
        /// 订单号
        /// </summary>
        [DataMapping("OrderID", DbType.Int32)]
        public int OrderID { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [DataMapping("OrderBy", DbType.Int32)]
        public int OrderBy { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [DataMapping("Description", DbType.String)]
        public string Description { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [DataMapping("CreateDate", DbType.DateTime)]
        public DateTime CreateDate { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [DataMapping("UpdateDate", DbType.DateTime)]
        public DateTime UpdateDate
        { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [DataMapping("CreateUser", DbType.String)]
        public string CreateUser { get; set; }

        /// <summary>
        /// 更新人
        /// </summary>
        [DataMapping("UpdateUser", DbType.String)]
        public string UpdateUser { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        [DataMapping("IsDelete", DbType.Int32)]
        public int IsDelete { get; set; }

        /// <summary>
        /// 广告位名称
        /// </summary>
        [DataMapping("SpaceName", DbType.String)]
        public string SpaceName { get; set; }

        /// <summary>
        /// 广告版块名称
        /// </summary>
        [DataMapping("BoardName", DbType.String)]
        public string BoardName { get; set; }

        /// <summary>
        /// 有效时间
        /// </summary>
        [DataMapping("ValidTime", DbType.String)]
        public string ValidTime
        { get; set; }

        /// <summary>
        /// 广告位编号
        /// </summary>
        [DataMapping("SpaceNO", DbType.String)]
        public string SpaceNO { get; set; }


        [DataMapping("SpaceType", DbType.Int32)]
        public int SpaceType { get; set; }

        public string BeginDate
        { get; set; }

        public string EndDate
        { get; set; }
    }
}
